package org.opens.simpleApi.controller;

import org.opens.simpleApi.dto.FormDataEntity;
import org.opens.simpleApi.dto.ObjParam;
import org.opens.simpleApi.dto.RequestBodyParam;
import org.opens.util.R;
import org.springframework.web.bind.annotation.*;

/**
 * 功能描述
 *
 * @author by zhangyuming
 * @date 2022/10/25
 */
@RestController
@RequestMapping(value = "/simpleApi")
public class SimpleApiController {

    @GetMapping(value = "/doGet")
    public R<String> doGet(@RequestParam(value = "id") String id) {
        return R.success(id);
    }

    @PostMapping(value = "/doPost")
    public R<String> doPost(@RequestParam(value = "id") String id) {
        return R.success(id);
    }

    @PostMapping(value = "/doRequestBody")
    public R<RequestBodyParam> doRequestBody(@RequestBody RequestBodyParam requestBodyParam) {
        return R.success(requestBodyParam);
    }

    @PostMapping(value = "/doRequestObj")
    public R<ObjParam> doRequestObj(ObjParam objParam) {
        return R.success(objParam);
    }

    @PutMapping(value = "/doPut")
    public R<String> doPut(@RequestParam(value = "id") String id) {
        return R.success(id);
    }

    @DeleteMapping(value = "/doDelete")
    public R<String> doDelete(@RequestParam(value = "id") String id) {
        return R.success(id);
    }

}
